﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using IPC.Communication.Profinet.AllenBradley;
using IPC.Communication.Reflection;

namespace IPC.Communication.Profinet.Melsec
{
    public class MelsecCipNet : AllenBradleyNet
    {
        public MelsecCipNet()
        {
        }

        public MelsecCipNet(string ipAddress, int port = 44818)
            : base(ipAddress, port)
        {
        }

        [HslMqttApi("ReadByteArray", "")]
        public override OperateResult<byte[]> Read(string address, ushort length)
        {
            return Read(new string[1]
		{
			address
		}, new int[1]
		{
			length
		});
        }

        //[AsyncStateMachine(typeof(<ReadAsync>d__3))]
        //[DebuggerStepThrough]
        //public override Task<OperateResult<byte[]>> ReadAsync(string address, ushort length)
        //{
        //    <ReadAsync>d__3 stateMachine = new <ReadAsync>d__3();
        //    stateMachine.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
        //    stateMachine.<>4__this = this;
        //    stateMachine.address = address;
        //    stateMachine.length = length;
        //    stateMachine.<>1__state = -1;
        //    stateMachine.<>t__builder.Start(ref stateMachine);
        //    return stateMachine.<>t__builder.Task;
        //}
    }
}
